#!/usr/bin/env python
# -*- coding: utf-8 -*-

import random

#随机生成十个数字

#list = [random.randint(0,1000) for i in range(10)]
li = [174, 321, 399, 92, 566, 153, 226, 816, 856, 136]
#冒泡排序
def bubble_sort(li):
    for i in range(len(li)-1):
        exchange = True
        for j in range(len(li)-1-i):
            if li[j] > li[j+1]:
                li[j],li[j+1] = li[j+1],li[j]
                exchange = False
        print(li)
        if exchange:
            return

ll = list(range(10))

bubble_sort(li)


